package com.nenglai.common.util;

import java.io.File;

/**
 * @author kongdehui
 * @date 2021/06/18 15:16
 **/
public class FileUtil {
    /**
     * @param imgUrl
     * @return
     */
    public static String suffix(String imgUrl) {
        return imgUrl.substring(imgUrl.lastIndexOf(".") + 1);
    }

    /**
     * 检查并创建目录
     *
     * @param path
     * @return void
     * @author kongdehui
     * @date 2021/05/20 13:19
     */
    public static void checkAndCreatDir(String path) {
        File file = new File(path);
        if (!file.exists()) {
            file.mkdirs();
        }
    }
}
